package com.scs.application.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.SimpleDataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "系统初始化日志表")
@TableName("sys_init_data_log")
public class InitDataLog extends SimpleDataEntity {


    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "初始化数据文件里的ID",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Integer sqlId;

    @EntityFieldAnnotation(
            text = "描述",
            length = "255",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String description;

    @EntityFieldAnnotation(
            text = "表名s",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String tableNames;

    @EntityFieldAnnotation(
            text = "执行的sql",
            type = EntityFieldType.LONGTEXT,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String sqls;

    @EntityFieldAnnotation(
            text = "校验码",
            length = "32",
            not_null = false,
            default_value = "",
            comment = "sha256算法"
    )
    private String checkCode;

    @EntityFieldAnnotation(
            text = "执行时间",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date execTime;

    @EntityFieldAnnotation(
            text = "执行结果",
            length = "",
            not_null = false,
            default_value = "",
            comment = "0：成功；Java执行错误代码"
    )
    private Integer execCode;

    @EntityFieldAnnotation(
            text = "出错信息",
            type = EntityFieldType.TEXT,
            length = "65535",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String execMessage;

    @EntityFieldAnnotation(
            text = "文件名称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String fileName;

    //执行是否成功 1：成功；0:失败
    @TableField(exist = false)
    private Integer execSuccess;

}
